package com.mvp.shq.washer.entity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/8/29.
 */

public class Banner {

    /**
     * id : a4d44ea023c3468e8dc54bcf4ef9b720
     * des : haa
     * imgUrl : /userfiles/1/images/photo/2017/08/Koalas.jpg
     * linkUrl : 123
     * bannerType : 0
     * status : 1
     */

    private String id;
    private String des;
    private String imgUrl;
    private String linkUrl;
    private String bannerType;
    private String status;

    public static Banner objectFromData(String str) {

        return new Gson().fromJson(str, Banner.class);
    }

    public static List<Banner> arrayBannerFromData(String str) {

        Type listType = new TypeToken<ArrayList<Banner>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public String getImgUrl() {
        return "http://web.uzhixi.com"+imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getLinkUrl() {
        return linkUrl;
    }

    public void setLinkUrl(String linkUrl) {
        this.linkUrl = linkUrl;
    }

    public String getBannerType() {
        return bannerType;
    }

    public void setBannerType(String bannerType) {
        this.bannerType = bannerType;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
